import * as VueRouter from "vue-router";
import Home from "../views/Home.vue";
import GoodsManage from "../views/GoodsManage.vue";
import ClientManage from "../views/ClientManage.vue";
import User from "../views/User.vue";
import Contract from "../views/Contract.vue";
import Login from "../views/Login.vue";

//index.ts

const router =VueRouter.createRouter({
    history: VueRouter.createWebHashHistory(),
    routes: [
        {
            path: "/", redirect: "/login",
        },
        {
            name: "login",
            path: "/login",
            component: Login,
        },
        {
            name: "home",
            path: "/home",
            component: Home,
            children: [
                {name: "goodsManage", path: "goodsManage", component: GoodsManage},
                {name: "clientManage", path: "clientManage", component: ClientManage},
                {name: "user", path: "user", component: User},
                {name: "contract", path: "contract", component: Contract},
            ],
        },
    ],
});

export default router;





